package com.prik.factory.simple;

import com.prik.factory.simple.pizza.Pizza;

/**
 * @description: 披萨店
 * @author: prik
 * @create: 2019-07-26
 **/
public class PizzaStore {

    private SimplePizzaFactory pizzaFactory;

    public PizzaStore(SimplePizzaFactory pizzaFactory) {
        this.pizzaFactory = pizzaFactory;
    }

    public Pizza orderPizza(String type) {

        // Pizza pizza = new Pizza();
        Pizza pizza = pizzaFactory.createPizza(type);

        pizza.prepare();
        pizza.bake();
        pizza.cut();
        pizza.box();
        return pizza;
    }
}